#ifndef __LATESTSERVICECLIENT_H__
#define __LATESTSERVICECLIENT_H__


#include "../facecat/stdafx.h"
#include "../facecat/include/service/FCClientService.h"
#include "Security.h"
#define FUNCTION_SUBCODES 0
#define FUNCTION_UNSUBCODES 1
#define FUNCTION_NEWDATA 2

/*
 * 最新数据服务
 */
class LatestServiceClient:  public FCClientService{
public:
    bool m_connected;
    int m_socketID;
public:
    LatestServiceClient();
    /*
     * 获取套接字
     */
    int getSocketID();
    /*
     * 设置套接字
     */
    void setSocketID(int value);
    /*
     * 注册代码
     *@param requestID 请求ID
     *@param codes 代码
     */
    void subCodes(int requestsID, String codes);
    /*
     * 反注册代码
     *param requestID 请求ID
     */
    void unSubCodes(int requestID);
    /*
     * 获取最新数据
     *@param body 包体
     *@param bidyLength 包体长度
     */
    static SecurityLatestData getLatestData(char* body, int bodyLength);
    /*
     * 接收消息方法
     */
    virtual void onReceive(FCMessage *message);
    /*
     * 客户端关闭
     */
    virtual void onClientClose(int socketID, int localSID);
};


#endif

